using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.VisualStudio.DebuggerVisualizers;
using System.Windows.Forms;

[assembly: System.Diagnostics.DebuggerVisualizer(
    typeof(GraphAlgsPresentation.ScriptLibrary.ScriptVisualizer), 
    typeof(VisualizerObjectSource),
    Target = typeof(GraphAlgsPresentation.ScriptLibrary.VisualScript),
    Description = "Script visualizer")]
namespace GraphAlgsPresentation.ScriptLibrary
{
    class ScriptVisualizer : DialogDebuggerVisualizer
    {
        /// <summary>
        /// Show the ScriptVisualizer
        /// </summary>
        /// <param name="windowService">An object of type <see cref="T:Microsoft.VisualStudio.DebuggerVisualizers.IDialogVisualizerService"></see>, which provides methods your visualizer can use to display Windows forms, controls, and dialogs.</param>
        /// <param name="objectProvider">An object of type <see cref="T:Microsoft.VisualStudio.DebuggerVisualizers.IVisualizerObjectProvider"></see>. This object provides communication from the debugger side of the visualizer to the object source (<see cref="T:Microsoft.VisualStudio.DebuggerVisualizers.VisualizerObjectSource"></see>) on the debuggee side.</param>
        protected override void Show(IDialogVisualizerService windowService, 
            IVisualizerObjectProvider objectProvider)
        {
            VisualScript script = objectProvider.GetObject() as VisualScript;
            frmScriptVisualizer frm = new frmScriptVisualizer();
            frm.Script = script;
            windowService.ShowDialog(frm);
        }
    }
}
